package com.ovhoo.vdm.vdm;

import java.util.ArrayList;

import android.os.Message;


public class VDMDownloadRequest {
	//Manage requests
	public enum requestType  {IDLE, LOAD_LATEST_QUOTES,  LOAD_RANDOM_QUOTES, LOAD_TOP_QUOTES, LOAD_FLOP_QUOTES, LOAD_QUOTE_COMMENTS_BY_ID};

	public requestType reqType = requestType.IDLE;
	private int requestParam = 0;
	private Message message = null;
	private String langage;
	
	public VDMDownloadRequest(requestType type, int param, Message msg, String lng){
		this.reqType = type;
		this.requestParam = param;
		this.message = msg;
		this.langage = lng;
	}
	
	/**
	 * call tis metode when the request was taken into acount
	 * @param the quotes as result of the request
	 */
	public void achieve(ArrayList<VDMQuote>  quotes){
		this.message.obj = quotes;
		this.message.sendToTarget();
	}
	
	/**
	 * returns the request type
	 * @return
	 */
	public requestType getType(){
		return this.reqType;
	}
	
	/**
	 * Returns the request param
	 * @return
	 */
	public int getParam(){
		return this.requestParam;
	}

	public String getLangage() {
		return this.langage;
	}
}